@if($user)
<ul class="nav navbar-nav">
    <li class="dropdown dropdown-notification nav-item">
        <a class="nav-link nav-link-label" href="#" data-toggle="dropdown" aria-expanded="true">
            <i class="ficon feather icon-bell"></i>
            <span id="new_number_1" class="badge badge-pill badge-primary badge-up">0</span>
        </a>
        <ul class="dropdown-menu dropdown-menu-media dropdown-menu-right ">
            <li class="dropdown-menu-header">
                <div class="dropdown-header m-0 p-2">
                    <h3 class="white"></h3>
                    <span class="grey darken-2">新消息</span>
                </div>
            </li>

            <li class="scrollable-container media-list ps ps--active-y">

                <a class="d-flex justify-content-between">
                    <div class="media d-flex align-items-start">

                        <div class="media-body">
                            <h4 class="primary media-heading">
                                资料报审中有
                                <h2 style="color:red" id="new_number_2">0</h2>
                                条待处理信息,请尽快处理
                            </h4>
                        </div>

                    </div>
                </a>

        </ul>
    </li>
</ul>


<script>
    var getting = {
        url:'http://47.110.78.240/api/ziliaoMessage?user_id='+{{$user->id}},
        dataType:"json",
        success:function(res) {
            if(res.code == 200){
                console.log(res.re)
                $('#new_number_1').html(res.re);
                $('#new_number_2').html(res.re);

            }

        },
        error: function (res) {
            console.log(res);
        }
    };
    window.setInterval(function() {
        $.ajax(getting)
    },60000);
</script>
@endif
